<template>
    <section class="integral-subsidiary-main base-main">
      <pull-up-reload
        :on-infinite-load="onInfiniteLoad"
        :parent-pull-up-state="infiniteLoadData.pullUpState"
        >
        <ul class="bgcFFF">
          <li class="box line-bottom pr" v-for="(item, index) in pointData" :key="index">
            <p class="fs16 color45454D">{{item.type_name}}</p>
            <p class="fs12 color999AA3">{{item.create_time}}</p>
            <span class="point pa" :class="Number(item.points) > 0 ? 'color7E82F6' : ''">{{item.points}}</span>
          </li>
        </ul>
      </pull-up-reload>
    </section>
</template>

<script type="text/ecmascript-6">
  import PullUpReload from '../../components/PullUpReload.vue'

  export default {
    components:{
      PullUpReload
    },
    data() {
      return {
        pointData:[
          {
            type: "2",		//类型1:消费积分2:分享积分3:签到积分4:推荐积分5: 积分抵扣
            type_name: "分享积分",	//类型中文名称
            points: "5",		//积分
            create_time: "2019-04-17 16:37:00"	//时间
          },
          {
            type: "5",
            type_name: "积分抵扣",
            points: "-5",
            create_time: "2019-04-18 16:37:00"
          }
        ],
        page:0,
        // 上拉加载的设置
        infiniteLoadData: {
          initialShowNum: 3, // 初始显示多少条
          everyLoadingNum: 3, // 每次加载的个数
          pullUpState: 0, // 子组件的pullUpState状态
          pullUpList: [], // 上拉加载更多数据的数组
          showPullUpListLength: this.initialShowNum // 上拉加载后所展示的个数
        },
      }
    },
    methods: {
      // 上拉加载
      onInfiniteLoad (done) {
        if (this.infiniteLoadData.pullUpState === 0) {
//          this.getPullUpMoreData()
        }
        done()
      }
    },
  }
</script>

<style scoped lang="scss">
  @import '../../assets/css/integralSubsidiary.scss';
</style>
